package com.example.yrdev.ordering_system.Database;

import android.content.Context;

import com.example.yrdev.ordering_system.Model.Good;

import java.util.ArrayList;

/**
 * Created by luke on 11/5/16.
 */

public class MenuItemTB {//商品列表显示的商品


    public static   final String DH_TABLE_NAME = "Menu_Item";

    public static   final String  item_ID="item_ID";//商品编号
    public static   final String  item_name="item_Name";//商品名称
    public static  final String  item_amount="item_amount";//数量
    public static  final String  item_retailPrice="item_retailPrice";

    public static  final String  item_purchDate="item_purchDate";
    public static  final String  item_purchTime="item_purchTime";
    public static  final String  item_payMode="item_payMode";//0 现金,1 信用卡,2 签单,3 会员卡,4 礼劵, 8 - 退货  会员卡,9 - 退货  现金
    public static  final String item_Discount="item_Discount";
    public static  final String item_PrimeCost="item_primeCost";//进货价
    public  static final String item_SaleCost="item_saleCost";//会员价
    public static  final String item_EmployeID="EmployeeID";




    Context context;


    public  static final String DH_CREATE_TABLE="CREATE TABLE " + DH_TABLE_NAME + "( " + item_ID + " TEXT," + item_name + " TEXT, " + item_amount + " INTEGER,"
            + item_retailPrice + " INTEGER"+  ")";


    public static ArrayList<Good> getAllMenuList(Context context){

   return DingHanDB.getInstance(context).getAllMenuItem();


    }

    public static void insertItem(Context context, Good goods){
       DingHanDB.getInstance(context).insert(DH_TABLE_NAME,goods);

    }

    public static void removeItem(Context context,Good goods){


        DingHanDB.getInstance(context).deleteItem(goods.getId());


    }



}
